<include file="../Public/_header" />
<include file="__THEME__/editor" />
<script type="text/javascript" src="../Public/Js/addBlog.js"></script>
<div class="content no_bg"><!-- 内容 begin  -->
  <div class="main no_l"><!-- 画布 begin  -->
    <div class="mainbox">
    <include file="../Public/_right" />
    <div class="mainbox_C">
    <form action="{$link}" method="post" onsubmit="return check()">
    <div class="page_title"> 
            <h2>
                <span class="f12px fn right"><a href="javascript:history.back( -1 )">&lt;&lt;返回上一页</a></span>
                修改日志</h2>
        </div>
        <div class="BlogBox">
                    <script type="text/javascript" charset="utf-8">
                        var outline = '{$saveId}';
                        var friendId = new Array();
                        var friend_name = new Array();
                        var friend = JSON.parse('{$mention}');
                        var result="";
                        $( document ).ready( function(){
                            /*
                        KE.show({
                           id : 'content',
                            cssPath : PUBLIC+'/js/kindeditor-3.2/index.css',
                                    emoticons: {$smileList},
                                    emoticonsPath:"{$smilePath}",
                        items: ['fontname','fontsize','textcolor','bgcolor','bold','italic','underline','justifyfull','justifyright','justifyleft','justifycenter','link','image','flash','media','emoticons','source','preview']
                        });
                             */

                            if( outline != '' ){
                                var time = 3*60*1000;
                                var t = setInterval( 'autosave()',time );
                            }

                            $( '#privacy option[value={$private}]' ).attr( 'selected',true );
                            $( '#cc option[value={$canableComment}]' ).attr('selected',true);
                            $( "#select option[value={$category['id']}]" ).attr( 'selected',true );

                            if($('.attach').html()){
                                var temp = $('.attach').clone();
                                                                $('.attach').remove();
                                                                $('#attach_upload_data').append(temp.html());

                            }


                        });
                        for( one in friend ){
                            friendId[one] = friend[one].uid;
                            result += parseImage( friend[one] );
                        }
                        $(".ui-fs-result").append( result );
                        var value=friendId.join( ',' );
                        $( '#ui_fri_ids' ).val( value );
                        function parseImage( vo ){
                            var result = "<a href='javascript:void(0)' name='" + vo.uid + "'><img width='20' height='20' src='" + vo.face + "' title='" + vo.uid + "' alt='' />" + vo.name + "<span title='移除该好友'>移除该好友</span></a>";
                            return result;
                        }


                    </script>
       </div>
         <div class="LogList"><!-- 好友博客 begin  -->
                    <ul class="edit">
                        <li style="padding:0; height:26px;">
                            <div class="c1">标题：</div>
                            <div class="c2"><select name="category" class="text mr5" id="select" onchange="javascript:changeCategory($(this))">
                                    <php>foreach( $category_list as $value ){</php>
                                    <option value="{$value['id']}">{$value['name']}</option>
                                    <php>}</php>
                                    <optgroup id="group">
                                        <option value="0">+添加分类</option>
                                    </optgroup>
                                </select>
                                <input id="title" name="title" type="text" class="text" style="width:60%; onBlur="this.className='text'" onFocus="this.className='text2'" value="{$title}" maxlength="25"/>
                            </div>
                        </li>
                        <li style="padding:0;">
                            <div class="c1">内容：</div>
                  <div class="c2">
                    <textarea id="content" name="content" style="height:350px">{$content}</textarea>                                        
                  </div>
                        </li>
                        <li style="padding:0;">
                           

                        <php>if( !empty( $saveId ) ){</php>
                        <li style="padding:0;">
                            <div class="c1"></div>
                        </li>
                        <php>}</php>

                          <neq name ="attach" value="">
                            <div class ="attach" style="display:none;">
                                <volist name ="attach" id="vo"></volist>
                                <input class="attach{$vo['id']}" type="hidden" name="attach[]" value="{$vo['id']}|{$vo['name']}"><p>
                                    <span class="attach{$vo['id']}"> [附件] {$vo['name']}</span>
                                    <span class="attach{$vo['id']}"><a class="attach{$vo['id']}" href="javascript:void(0)" onclick="deleteAttach({$vo['id']})">删除</a></span></p>
                                </volist>
                            </div>
                        </neq>
                        <li style="padding:0;">
                            <div class="c1">&nbsp;</div>
                            <div class="c2" style="height:30px;">


                                <input id="id" name="id" type="hidden" value="{$id}">
                                <input id="friendid" name="mention" type="hidden" value="">
                                <input type="submit" class="btn_b" value="发 表" />
                                <php>if( !empty( $saveId ) ){</php>
                                <input id="saveButton" type="button" onclick="javascript:autosave()"class="btn_b" value="存至草稿箱"/> <span id="autoSave" style="display:none;"></span>
                                <input id="saveId" name="saveId" type="hidden" value="{$saveId}"/>
                                <php>}else{</php>
                                <input id="saveButton" type="button" onclick="javascript:history.back(-1)"class="btn_w" value="取消"/>
                                <php>}</php>
                            </div>
                        </li>
                    </ul>
          </div>
          </form>
        </div>
    </div>
    <div class="c"></div>
    </div>
    </div>
    <script>
$(document).ready(function(){
	//E	=	KISSY.Editor( "content" );
	loadEditor("content");
});
</script> 
<include file="__THEME__/footer" />
